package work9Y7D;

import java.util.Arrays;
import java.util.Scanner;

public class HomeWork04 {
	public static void main(String[] args) {
		int oldArr[]={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5};
		int zero=0;
		for (int i = 0; i < oldArr.length; i++) {
			if(oldArr[i]==0){
				zero++;
            }
		}
        int[] Arr = new int[oldArr.length-zero];
        int t = 0;
        for(int i = 0; i < oldArr.length; i++){
            if(oldArr[i]==0){
            	continue;
            }
            else {
            	Arr[t]=oldArr[i];
            	t++;
			}
        }
        
        System.out.println(Arrays.toString(Arr));
	}
}
